<script type="text/javascript" language="javascript" charset="utf-8">
//<![CDATA[
document.observe("contextmenu", function(event){
    event.stop();
});
<% if shops.present? %>
  document.observe("dom:loaded", function() {
  <% prom_links = shops.map{ |shop| shop.prom_link.nil? ? nil : "shopid#{shop.id}:'#{shop.prom_link}'" }.reject(&:nil?) %>
  <% if prom_links.present? %>
  var shop_links = $H({<%= raw prom_links.join(',') %>});
  $$('a[class|="shopid"]').each(function(item){
    item.observe('click', function(event){
      var shop_link = shop_links.get(item.className.sub('-',''));
      if(shop_link){
        var old_href = item.href;
        item.href = shop_link;
        (function(){item.href=old_href}).defer();
      }
    });
  });
  <% end %>
  });
<% end %>
//]]>
</script>
